package marble {

	import mx.containers.ViewStack;
	import mx.core.Application;

	public class MainAppClass extends Application {

		[Bindable]
		public var viewStack:ViewStack;

		/**
		 * Types of application:
		 * 
		 * "default"		read-only plan for public audience
		 * "organizer"		editable for the organizers only
		 * "participant"	editable private plan of a user
		 */
		private var appType:String;

		override protected function childrenCreated():void {

			super.childrenCreated();

			appType = parameters.app_type;
			switch (appType) {
				case "default":
					viewStack.selectedIndex = 0;
					break;
				case "organizer":
					viewStack.selectedIndex = 1;
					break;
				case "participant":
					viewStack.selectedIndex = 2;
					break;
			}

			// force initialization
			Facade.getInstance();
		}
	}
}